package game.view.mainUI
{
	import flash.display.MovieClip;
	import flash.events.MouseEvent;
	import flash.text.TextField;
	
	import game.UIComponent.Button;
	import game.UIComponent.Panel;
	import game.common.CustomBitmap;
	import game.common.Reflection;
	
	import game.utils.Utils;
	


	
	public class AnnounceView extends Panel
	{
		private var _bar:CustomBitmap;
		private var _gonggao:CustomBitmap;
		private var _bg2:CustomBitmap;
		private var _decide:Button;
		private var _close:Button;
		private var _mytext:TextField;
		private var _text:String;
		

		public function AnnounceView()
		{
			init();
		}
		
		override protected function init():void
		{
			super.init();
			setBgImage("bg",500,400);
			setCenter();
			
			_bg2=new CustomBitmap();
			_bg2.source="bg2";
			_bg2.x=20;	
			_bg2.y=40;
			_bg2.scaleX=1.58;
			_bg2.scaleY=2;
			addChild(_bg2);
			
			_bar=new CustomBitmap();
			_bar.source="bar";
			_bar.x=120;	
			_bar.y=-20;
			addChild(_bar);
			
			_gonggao=new CustomBitmap();
			_gonggao.source="gonggaotext1";
			_gonggao.x=_bar.x+_bar.width/3-20;	
			_gonggao.y=_bar.y-10;

			addChild(_gonggao);
			
			
			_decide=new Button("","confirm1");
			_decide.name="confirm1";
			_decide.x=215;
			_decide.y=345;	
			_decide.addEventListener(MouseEvent.CLICK,clickHandler);
			addChild(_decide);
			
			_close=new Button("","close1");
			_close.name="close1";
			_close.x=_bar.x+_bar.width+50;
			_close.y=_bar.y+10;
			_close.addEventListener(MouseEvent.CLICK,clickHandler);
			addChild(_close);
			
			
			_text="终极方舟建造功能将于12.8中午12点左右后批量开放给大家~"+"\n"+
                "赶快将你的诺亚方舟升级到终极方舟吧！看到冒泡的方舟图标，"+"\n"+
				"马上点击！";
			_mytext=Utils.getCommonTextField(_text,16,_bg2.x+10,_bg2.y+10);
			addChild(_mytext);
					
			this.addEventListener(MouseEvent.MOUSE_DOWN,act1_mc);
			this.addEventListener(MouseEvent.MOUSE_UP,act2_mc);
		
			
	

		}
		
		private function clickHandler(e:MouseEvent):void
		{
			this.isPop=false;

		}
		private function act1_mc(evt:MouseEvent):void
		{
			if(mouseX>_bar.x&&mouseX<_bar.x+_bar.width&&mouseY>_bar.y&&mouseY<_bar.y+_bar.height)
			{
			   this.startDrag();
			}

		}
		private function act2_mc(evt:MouseEvent):void
		{
			this.stopDrag();
		}
	}
	
}